class WorkItemType < ActiveRecord::Base
  has_and_belongs_to_many :stages
  has_many :designer_work_items

  validates_presence_of :name
  validates_uniqueness_of :name
  
  def designer_work_items_by_stage_id(stage_id)
    DesignerWorkItem.find_all_by_stage_id_and_work_item_type_id(stage_id,id)
  end

end
